import Vue from 'vue'
import Route  from 'vue-router'
import HelloWorld from '@/components/HelloWorld'
import Btn from "@/components/Btn"
import Login from "@/components/Login"
import Home from "@/components/Home"
import Menu from "@/components/Menu"
import User from "@/components/User"
import Role from "@/components/Role"

Vue.use(Route)


export default new Route({
  //mode: 'history', // 如果不加这段代码，地址中间有#号
  routes: [
    {
      path: '/login',
      name: 'Login',
      component: Login
    },
    {
      path: '/',
      component: Home
    },
    {
      path: '/home',
      name: 'Home',
      component: Home,
      children:[
          {
            path: '/',
            name: 'HelloWorld',
            component: HelloWorld
          },
          {
            path: 'btn',
            name: 'Btn',
            component: Btn
          },
          {
            path: 'hello',
            name: 'HelloWorld',
            component: HelloWorld
          },
          {
            path: 'menu',
            name: 'Menu',
            component: Menu
          },
          {
            path: 'user',
            name: 'User',
            component: User
          },
          {
            path: 'role',
            name: 'Role',
            component: Role
          },
      ]
    },
  ]
})
